<template>
	<view class="content">
	<view class="topbackgroundbox">
		<view class="topsmallbox"></view>
	</view>	
	<view class="box">
		
	</view>
	<view class="topbox" v-if="flag">
		
		<view class="topleftbox">
			<image src="../../static/User 60.png" mode=""></image>
			 
		<text>{{user}}</text>
		</view>
		<view class="toprightbox">切换账号 <image src="../../static/Arrow Right 2.png" mode=""></image> </view>
	</view>
	<view class="nologin" v-else>
		<image src="../../static/User 60.png" mode=""></image>
		<view><text @click="gologin">登录</text>/<text @click="goreg">注册</text></view>
	</view>
	<view class="bottombox">
		<view class="bottomsmallbox1 smallbox" @click="contacts">
			<view class=" small">
				<image src="../../static/联系人.png" mode=""></image>
				<text>常用联系人</text>
			</view>
			<view class="rightimg">
				<image src="../../static/Arrow Right.png" mode=""></image>
			</view>
			
		</view>
		<view class="bottomsmallbox2 smallbox">
			<view class=" small">
				<image src="../../static/订单.png" mode=""></image>
				<text>我的订单</text>
			</view>
			<view class="rightimg">
				<image src="../../static/Arrow Right.png" mode=""></image>
			</view>
		</view>
		<view class="bottomsmallbox3 smallbox">
			<view class=" small">
				<image src="../../static/个人中心 客服.png" mode=""></image>
				<text>客服中心</text>
			</view>
			<view class="rightimg">
				<image src="../../static/Arrow Right.png" mode=""></image>
			</view>
		</view>
	</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// title: 'Hello'
				flag:false,
				user:''
			}
		},
		onLoad() {
		
		},
		
		methods: {
		contacts(){
			uni.navigateTo({
				url:'/pages/passenger/passenger'
			})
		},
		gologin(){
			uni.navigateTo({
				url:'/pages/login/login'
			})
		},
		goreg(){
			uni.navigateTo({
				url:'/pages/reg/reg'
			})
		}
		},
		onShow(){
			console.log('onshow');
			let user=uni.getStorageSync("token");
			if(user){
				this.user=user
				this.flag=true
			}else{
				this.flag=false
			}
		},
	}
</script>

<style>
	.content{
		width: 100vw;
		height: 100vh;
		background: rgba(200,200,200,0.1);
	}
	.topbackgroundbox{
		background: rgb(0,172,189);
		width: 100%;
		height: 520rpx;
		padding-top:467rpx;
		box-sizing: border-box;
		position: fixed;
		top: 0;
		z-index: -999;

	}
	.topsmallbox{
		background: rgb(0,172,189);
		width: 100%;
		height: 100rpx;
		border-radius: 50%;
	}
	.topleftbox image{
		width: 70rpx;
		height: 70rpx;
		margin-right: 15rpx;
	}
	.box{
		height: 200rpx;width: 100%;
	}
	.topbox{
		display: flex;
		justify-content: space-around;
		height: 100rpx;
		color:#fff;
		
	}
	.topleftbox{
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100rpx;
	}
	.toprightbox{
		display: flex;
		justify-content: center;
		align-items: center;
		height: 100rpx;
		font-size: 14px;
		font-weight: 300;
	}
	.toprightbox image{
		width: 25px;
		height: 25px;
	}
	.bottombox{
		width: 94%;
		margin-left: 3%;
		margin-top: 80rpx;
		height: 340rpx;
		background: #fff;
		border-radius: 20rpx;
		box-shadow: 0 0 20px rgba(0,0,0,0.2);
		padding: 20rpx 50rpx;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
	}
	.smallbox{
		width: 100%;
		height: 100rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.small{
		display: flex;
		
	}
	.bottomsmallbox1{
		border-bottom: #ccc 1px solid;
	}
	.bottomsmallbox2{
		border-bottom: #ccc 1px solid;
	}
	.smallbox image{
		width: 60rpx;
		height: 60rpx;	
	}
	text{
		font-size: 14px;
		line-height: 60rpx;
		margin-left: 10rpx;
	}
	.smallbox .rightimg image{
		width: 40rpx;
		height: 40rpx;
	}
	.nologin image{
		width: 100rpx;
		height: 100rpx;
		
	}
	.nologin{
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		color: #fff;
	}
</style>
